package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;
	import flash.net.Socket;

	public class SpykeWidgetProxy implements SpykeWidget
	{
		public var remoteeID:int;
		protected var connection:RemedyClientServerConnection;

		public function SpykeWidgetProxy(remoteeID:int, connection:RemedyClientServerConnection)
		{
			this.remoteeID = remoteeID;
			this.connection = connection;
		}

		public function unPublish():void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 67);

			});
		}

		public function publish():void
		{
			connection.performRun(remoteeID, function(connection:RemedyClientServerConnection):void {

				RemedyCodec.writeMethodID(connection.getSocket(), 66);

			});
		}
	}
}
